Skip to content

feat(boto3): Add response, retry, and error span attributes - #7499

Merged
pabloDeputter merged 23 commits into
pablo/improve-boto3-call-lifecyclefrom
pablo/add-boto3-response-retry-error-attributes
Sep 30, 2026
Merged

pabloDeputter merged 23 commits into
pablo/improve-boto3-call-lifecyclefrom
pablo/add-boto3-response-retry-error-attributes

Conversation

@pabloDeputter

@pabloDeputter pabloDeputter commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Description

Add generic response, retry, and error attribute enrichment to boto3 spans. Previously, only recorded request and client metadata was instrumented; information after the call such as HTTP status, retry count, etc was omitted. The new attributes follow the OTel AWS SDK conventions.

Changes

  • add SPANDATA consts: AWS_REQUEST_ID, AWS_EXTENDED_REQUEST_ID, HTTP_REQUEST_RESEND_COUNT, and ERROR_TYPE.
  • add _get_response_attributes() to extract http.response_status_code, http.request_resend_count, aws.request_id, and aws.extended_request_id.
  • Add erorr.type from ClientError.Eror.Code or the exception class, without recording error messages.

Issues

Resolves #7476

@pabloDeputter
pabloDeputter added this pull request to stack #7500 September 14, 2026 12:53
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 132851 passed | ⏭️ 7220 skipped | Total: 140071 | Pass Rate: 94.85% | Execution Time: 452m 40s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +3487
Passed Tests 📈 +3524
Failed Tests 📉 -60
Skipped Tests 📈 +23

➖ Removed Tests (60)

View removed tests
  • test_input_attributes_nonstreaming_chat[False-True-False-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-True-False-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-True-False-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-True-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-True-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-True-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-False-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-False-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-False-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat[False-False-False-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-True-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-True-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-True-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-False-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-False-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-False-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-True-False-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-True-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-True-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-True-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-False-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-False-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-False-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[True-False-False-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-True-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-True-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-True-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-False-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-False-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-False-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-True-False-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-True-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-True-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-True-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-False-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-False-messages1-expected_system_instructions1-expected_input_messages1]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-False-messages2-expected_system_instructions2-expected_input_messages2]
    • File: tests.integrations.mistral.test_mistral
  • test_input_attributes_nonstreaming_chat_async[False-False-False-messages3-expected_system_instructions3-expected_input_messages3]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[True-True-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[True-True-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[True-False-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[True-False-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[False-True-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[False-True-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[False-False-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat[False-False-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[True-True-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[True-True-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[True-False-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[True-False-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[False-True-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[False-True-False]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[False-False-True]
    • File: tests.integrations.mistral.test_mistral
  • test_output_attributes_nonstreaming_chat_async[False-False-False]
    • File: tests.integrations.mistral.test_mistral
  • test_cache_spans_templatetag[True]
    • File: tests.integrations.django.test_cache_module

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2562 uncovered lines.
✅ Project coverage is 90.34%. Comparing base (6868ffd) to head (064eab6).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/boto3/_instrumentation.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
+ Coverage    90.30%    90.34%    +0.04%
==========================================
  Files          195       199        +4
  Lines        26261     26524      +263
  Branches      9798      9864       +66
==========================================
+ Hits         23714     23962      +248
- Misses        2547      2562       +15
- Partials      1485      1495       +10

Generated by Codecov Action

@pabloDeputter pabloDeputter changed the title Pablo/add boto3 response retry error attributes feat(boto3): Add response, retry, and error span attributes Sep 14, 2026
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from a15c641 to 56a7ab6 Compare September 14, 2026 14:42
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from 56a7ab6 to 176096b Compare September 15, 2026 12:58
Comment thread tests/integrations/boto3/test_client.py
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from af6b9a8 to 49474d0 Compare September 17, 2026 15:48
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch 2 times, most recently from 2e63bac to 35f0dc3 Compare September 17, 2026 16:00
@pabloDeputter
pabloDeputter marked this pull request as ready for review September 17, 2026 16:07
@pabloDeputter
pabloDeputter requested a review from a team as a code owner September 17, 2026 16:07
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from 76e7425 to f922864 Compare September 18, 2026 13:02

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread sentry_sdk/integrations/boto3/_client.py Outdated
@pabloDeputter
pabloDeputter removed this pull request from stack #7500 September 18, 2026 14:34
@pabloDeputter
pabloDeputter added this pull request to stack #7539 September 18, 2026 14:35
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from 4fae1c9 to cdd5c95 Compare September 18, 2026 15:06
@pabloDeputter
pabloDeputter removed this pull request from stack #7539 September 18, 2026 15:08
@pabloDeputter
pabloDeputter added this pull request to stack #7541 September 18, 2026 15:08
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from cdd5c95 to d55060f Compare September 18, 2026 15:20
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch 3 times, most recently from 6c9e3a8 to a72a791 Compare September 21, 2026 16:07
@pabloDeputter
pabloDeputter added this pull request to stack #7792 September 30, 2026 12:05
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from 6edfb01 to 850c129 Compare September 30, 2026 13:31
@pabloDeputter
pabloDeputter force-pushed the pablo/add-boto3-response-retry-error-attributes branch from 2718630 to 1f4e936 Compare September 30, 2026 14:05
@pabloDeputter
pabloDeputter merged commit bc11cb7 into master Sep 30, 2026
314 of 316 checks passed
@pabloDeputter
pabloDeputter deleted the pablo/add-boto3-response-retry-error-attributes branch September 30, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(boto3): Add generic response, retry, and error attributes

2 participants